package com.ruoyi.iot.service;


import com.ruoyi.iot.domain.FacTaskjob;
import com.ruoyi.iot.service.task.BaseTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DynamicTaskService extends BaseTaskService {

    @Autowired
    private IFacTaskjobService facTaskjobService;

    @Override
    public FacTaskjob getTaskBykey(String taskKey) {

        FacTaskjob facTaskjobEntity=new FacTaskjob();
        facTaskjobEntity.setTaskkey(taskKey);
        List<FacTaskjob> list= facTaskjobService.getTaskBykey(facTaskjobEntity);
        FacTaskjob firstData=list.get(0);
        return firstData;
    }

    @Override
    public List<FacTaskjob> getAllTask() {
        return  facTaskjobService.getTaskList();
    }

    @Override
    public List<FacTaskjob> getAllNeedStartTask() {
        return  facTaskjobService.getNeedStartTaskList();
    }
}
